<!-- IMAGE GALLERY ACCORDIAN SCRIPT -->

<script>
	$(document).ready(function() {
 
	//ACCORDION BUTTON ACTION	
	$('div.accbutton-images').click(function() {
		$('div.acccontent-images').slideUp('normal');	
		if(!$(this).next().is(':visible')){
        $(this).next().slideDown('slow');
        }
	});
 
	//HIDE THE DIVS ON PAGE LOAD	
	$("div.acccontent-images").hide();
 
});
</script>

	<h3><?php meta('pageGalleriesTitle'); ?></h3>
	<div id="accordian-wrapper" style="margin-bottom: 20px;">
		<?php // Include Image Gallery One If Available
			if(get_post_meta($post->ID, 'pageGalleryOne', true)) { ?>
				<div class="accbutton-images">
					<div class="accbutton-images-left"><?php meta('pageGalleryOneTitle'); ?></div>
					<div class="accbutton-images-right">View Images</div>
				</div>
				<div class="acccontent-images">
					<?php 
						$pagegalone = get_post_meta($post->ID, 'pageGalleryOne', true);
						echo nggShowGallery( $pagegalone );
					?>
				</div>
		<?php } ?>
		<?php // Include Image Gallery Two If Available
			if(get_post_meta($post->ID, 'pageGalleryTwo', true)) { ?>
				<div class="accbutton-images">
					<div class="accbutton-images-left"><?php meta('pageGalleryTwoTitle'); ?></div>
					<div class="accbutton-images-right">View Images</div>
				</div>
				<div class="acccontent-images">
					<?php 
						$pagegaltwo = get_post_meta($post->ID, 'pageGalleryTwo', true);
						echo nggShowGallery( $pagegaltwo );
					?>
				</div>
		<?php } ?>
		<?php // Include Tag Based Image Gallery If Available
			if(get_post_meta($post->ID, 'pageGalleryTag', true)) { ?>
				<div class="accbutton-images">
					<div class="accbutton-images-left"><?php meta('pageGalleryTagTitle'); ?></div>
					<div class="accbutton-images-right">View Images</div>
				</div>
				<div class="acccontent-images">
					<?php 
						$pagegaltag = get_post_meta($post->ID, 'pageGalleryTag', true);
						echo nggShowGallery( $pagegaltag );
					?>
				</div>
		<?php } ?>
		<?php // Include Tag Based Image Gallery If Available
			if(get_post_meta($post->ID, 'imagestag', true)) { ?>
				<div class="accbutton-images">
					<div class="accbutton-images-left"><?php meta('pageGalleryTagTitle'); ?></div>
					<div class="accbutton-images-right">View Images</div>
				</div>
				<div class="acccontent-images">
					<?php 
						$pagegaltag = get_post_meta($post->ID, 'imagestag', true);
						echo nggShowGallery( $pagegaltag );
					?>
				</div>
		<?php } ?>
	</div>